<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #demo1 {
            width: 10px;
            height: 10px;
            border-right: 2px solid black;
            border-bottom: 2px solid black;
            /* 顺时针旋转45度 */
            transform: rotate(45deg);
        }

        #demo2 {
            width: 10px;
            height: 10px;
            border-left: 2px solid black;
            border-top: 2px solid black;
            transform: rotate(225deg);
        }

        #demo3 {
            /* border是四个三角形渲染组成的 */
            border: 10px solid #fff;
            border-left-color: #f00;
            width: 0;
            height: 0;
        }
        #demo4{
            width: 0;
            height: 0; 
            border-right: 10px solid white;
            border-bottom: 10px solid black;
        }
    </style>
</head>

<body>
    <p>demo1</p>
    <div id="demo1"></div>
    <p>demo2</p>
    <div id="demo2"></div>
    <p>demo3</p>
    <div id="demo3"></div>
    <p>demo4</p>
    <div id="demo4"></div>

</body>

</html>